<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Ordergoods extends Model
{
    //购物车
    
    protected $table = 'yds_order_goods';

    protected $primaryKey = 'id';

    //关闭更新  'updated_at`, `created_at' 字段
    public $timestamps = false;

    //一对一关系(订单里书籍对应的图书信息)
    public function hasOnebooks()
    {
        return $this->hasOne('App\Models\Book','book_id','book_id');
    }
}
